package com.qdlc.p2p.dal.dto;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.qdlc.p2p.common.constant.Global;
import com.qdlc.p2p.common.util.DateUtil;

/**
 * 第三方商户平台操作记录
 *
 * @author liya
 * @version 1.1.0.0
 */
@Entity
@Table(name = Global.DB_PREFIX + "tpp_merchant_log")
public class TppMerchantLog {

    /** 主键 */
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private long id;

    /** 操作员ID */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "operator_id")
    private Operator operator;

    /** 付款账户 */
    private String account;

    /** 收款账户 */
    private String toAccount;

    /** 操作金额 */
    private double money;

    /** 操作手续费 */
    private double fee;

    /** 操作状态 */
    private byte status;

    /** 操作类型 */
    private byte type;

    /** 充值订单号 */
    private String orderId;

    /** 操作时间 */
    private Date addTime;

    /** 添加ip */
    private String addIp;

    /** 备注 */
    private String remark;

    public TppMerchantLog() {
    }

    public TppMerchantLog(Operator operator, String account, String toAccount,
                          double money, double fee, byte status, byte type, String orderId,
                          String remark) {
        this.operator = operator;
        this.account = account;
        this.toAccount = toAccount;
        this.money = money;
        this.fee = fee;
        this.status = status;
        this.type = type;
        this.orderId = orderId;
        this.remark = remark;
        this.addTime = DateUtil.getNow();
        this.addIp = Global.getIP();
    }

    /**
     * 获取主键
     *
     * @return 主键
     */
    public long getId() {
        return id;
    }

    /**
     * 设置主键
     *
     * @param id 主键
     */
    public void setId(long id) {
        this.id = id;
    }

    /**
     * 获取操作员
     *
     * @return 操作员
     */
    public Operator getOperator() {
        return operator;
    }

    /**
     * 设置操作员
     *
     * @param operator 操作员
     */
    public void setOperator(Operator operator) {
        this.operator = operator;
    }

    /**
     * 获取付款账户
     *
     * @return 付款账户
     */
    public String getAccount() {
        return account;
    }

    /**
     * 设置付款账户
     *
     * @param account 付款账户
     */
    public void setAccount(String account) {
        this.account = account;
    }

    /**
     * 获取收款账户
     *
     * @return 收款账户
     */
    public String getToAccount() {
        return toAccount;
    }

    /**
     * 设置收款账户
     *
     * @param toAccount 收款账户
     */
    public void setToAccount(String toAccount) {
        this.toAccount = toAccount;
    }

    /**
     * 获取操作金额
     *
     * @return 操作金额
     */
    public double getMoney() {
        return money;
    }

    /**
     * 设置操作金额
     *
     * @param money 操作金额
     */
    public void setMoney(double money) {
        this.money = money;
    }

    /**
     * 获取手续费金额
     *
     * @return 手续费金额
     */
    public double getFee() {
        return fee;
    }

    /**
     * 设置手续费金额
     *
     * @param fee 手续费金额
     */
    public void setFee(double fee) {
        this.fee = fee;
    }

    /**
     * 获取操作状态
     *
     * @return 操作状态
     */
    public byte getStatus() {
        return status;
    }

    /**
     * 设置操作状态
     *
     * @param status 操作状态
     */
    public void setStatus(byte status) {
        this.status = status;
    }

    /**
     * 获取操作类型
     *
     * @return 操作类型
     */
    public byte getType() {
        return type;
    }

    /**
     * 设置操作类型
     *
     * @param type 操作类型
     */
    public void setType(byte type) {
        this.type = type;
    }

    /**
     * 获取订单号
     *
     * @return 订单号
     */
    public String getOrderId() {
        return orderId;
    }

    /**
     * 设置订单号
     *
     * @param ordId 订单号
     */
    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    /**
     * 获取操作时间
     *
     * @return 操作时间
     */
    public Date getAddTime() {
        return addTime;
    }

    /**
     * 设置操作时间
     *
     * @param addtime 操作时间
     */
    public void setAddTime(Date addTime) {
        this.addTime = addTime;
    }

    /**
     * 获取操作IP
     *
     * @return 操作IP
     */
    public String getAddIp() {
        return addIp;
    }

    /**
     * 设置操作IP
     *
     * @param addip 操作IP
     */
    public void setAddIp(String addIp) {
        this.addIp = addIp;
    }

    /**
     * 获取备注
     *
     * @return 备注
     */
    public String getRemark() {
        return remark;
    }

    /**
     * 设置备注
     *
     * @param remark 备注
     */
    public void setRemark(String remark) {
        this.remark = remark;
    }
}
